package com.zyz.system.manager;

import com.zyz.common.core.constants.CacheConstants;
import com.zyz.common.redis.service.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class QuestionCacheManager {

    @Autowired
    private RedisService redisService;

    public void addCache(Long questionId) {
        redisService.leftPushForList(CacheConstants.QUESTION_LIST, questionId);
    }

    public void removeCache(Long questionId) {
        redisService.removeForList(CacheConstants.QUESTION_LIST, questionId);
    }


    public void removeHotQuestionId(Long questionId) {
        redisService.removeForZSet(CacheConstants.QUESTION_HOT,questionId);
    }
}
